<template>
    <div class="itemTop">
        <img :src="playlist.coverImgUrl" class="bgImg"/>
<div class="itemLeft">
    <svg class="icon" aria-hidden="true" @click="$router.go(-1)">
    <use xlink:href="#icon-fanhuijiantou"></use>
    </svg>
    <span>歌单</span>
</div>
<div class="itemRight">
    <svg class="icon" aria-hidden="true">
    <use xlink:href="#icon-sousuo"></use>
    </svg>
    <svg class="icon" aria-hidden="true">
    <use xlink:href="#icon-list"></use>
    </svg>
</div>
    </div>
  <div class="itemContent">
   <div class="contentLeft">
    <img :src="playlist.coverImgUrl" class="bg-img"/>
    <div class="playcount">
        <svg class="icon" aria-hidden="true">
          <use xlink:href="#icon-24gl-play"></use>
        </svg>
        <span>{{ changeCount(playlist.playCount) }}</span>
    </div>
   </div>
    <div class="contentRight">
        <p class="title">{{playlist.name}}</p>
        <div class="middle">
          <div class="middle-img"> 
            <img :src="playlist.creator.backgroundUrl" alt="" />
            <span>{{playlist.creator.nickname}}</span>
            <svg class="icon" aria-hidden="true">
          <use xlink:href="#icon-jinrujiantou"></use>
        </svg>
          </div>
        </div>
        <div class="bottom">
            <span>{{playlist.description }}</span> 
            <svg class="icon" aria-hidden="true">
          <use xlink:href="#icon-jinrujiantou"></use>
        </svg>
      
        </div>
    </div>
  </div>
  <div class="itemContentFooter">
    <div class="contentItem">
        <svg class="icon" aria-hidden="true">
        <use xlink:href="#icon-xinxi"></use>
      </svg>
      <span>{{ playlist.shareCount }}</span>
    </div>
    <div class="contentItem">
        <svg class="icon" aria-hidden="true">
        <use xlink:href="#icon-fenxiang"></use>
      </svg>
      <span>{{ playlist.shareCount }}</span>
    </div>
    <div class="contentItem">
        <svg class="icon" aria-hidden="true">
        <use xlink:href="#icon-xiazai"></use>
      </svg>
      <span>下载</span>
    </div>
    <div class="contentItem">
        <svg class="icon" aria-hidden="true">
        <use xlink:href="#icon-duoxuanxuanzhong"></use>
      </svg>
      <span>多选</span>
    </div>
  </div>
</template>

<script>
    export default {
        setup(props){
 if((props.playlist.creator="")){
    props.playlist.creator=JSON.parse(sessionStorage.getItem().playlist).creator
 }

function changeCount(num) {
      if (num >= 100000000) {
        return (num / 100000000).toFixed(1) + "亿";
      } else if (num >= 10000) {
        return (num / 10000).toFixed(1) + "万";
      }
    }
    return{changeCount}
        },
        props:['playlist']
    }
</script>

<style lang="less" scoped>
.itemTop{
    width: 100%;
    height: 50px;
    display: flex;
    justify-content: space-between;
 
    position: relative;
    .itemLeft,.itemRight{
        width: 25%;
        height: 100%;
        display: flex;
        justify-content: space-between;
        align-items: center;
        margin: 0 10px;
        span{
            font-size: 18px;
            color:#fff
        }
        .icon{
            fill:#fff
        }
    }
    .bgImg{
        width: 100%;
        height: 300px;
        position: absolute;
        z-index: -1;
        filter: blur(25px);
    }
}
.itemContent{
    width: 100%;
    height: 150px;
    display: flex;
    justify-content: space-between;
    margin-top: 10px;
    .contentLeft{
        width: 34%;
        height: 150px;
        position: relative;
        margin-left:14px;
        margin-top: 5px;
       
        .bg-img{
        width: 120px;
        height: 116px;
        border-radius: 10px;
        vertical-align: middle;
        position:absolute;
        z-index:-1
    }
    .playcount{
        position:absolute;
        right: 10px;

    .icon{
        vertical-align: middle;
        color: #fff;

    }
    span{
        color: #fff;
    }
    }
    }
    .contentRight{
        width: 60%;
    height: 2.6rem;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
        .title{
            font-size: 0.3rem;
      font-weight: 900;
      color: #fff;
      font-family: "微软雅黑";
        }
        .middle{
.middle-img{
    width: 100%;
      height: 0.6rem;
      line-height: 0.6rem;
      color: #ccc;
      img{
        width: 0.6rem;
        height: 0.6rem;
        border-radius: 50%;
        vertical-align: middle;
      }
      span {
        margin-left: 0.1rem;
      }
      .icon{
        width: 0.7rem;
        height: 0.7rem;
        margin-top: -0.08rem;
        vertical-align: middle;
      }
}
        }
        .bottom{
            width: 100%;
      height: 0.6rem;
      display: flex;
      align-items: center;
      justify-content: space-between;
        span {
        display: inline-block;
        width: 95%;
        height: 100%;
        overflow: hidden;
        text-overflow: ellipsis;
        display: -webkit-box;
        -webkit-line-clamp: 2;
        -webkit-box-orient: vertical;
        font-size: 0.24rem;
        color: #ccc;
      }
      .icon{
        width: 0.7rem;
        height: 0.7rem;
       
      }
      
        }
    }
   
}
.itemContentFooter{
    width: 100%;
    height: 80px;
    display: flex;
    justify-content: space-around;
    align-items: center;
    .contentItem{
        width: 25%;
        height: 100%;
        display: flex;
flex-direction: column;
align-items: center;
    color: #fff;
    .icon{
     width: 20px;
       
        fill: #fff;
    }
    span{
        font-size: 20px;
    }
    }
}
</style>